package org.game.gobang.client.init;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import org.game.codec.MsgpackDecoder;
import org.game.codec.MsgpackEncoder;
import org.game.gobang.client.GobangClient;
import org.game.gobang.client.handler.CustomizeClientHandler;
import org.game.gobang.client.handler.GobangClientHandler;

public class GobangClientInitializer extends ChannelInitializer<Channel> {

    @Override
    protected void initChannel(Channel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast("decoder", new MsgpackDecoder());
        pipeline.addLast("encoder", new MsgpackEncoder());
        pipeline.addLast(new CustomizeClientHandler());
    }
}